<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class User extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique()->nullable(false)->comment('用户名');
            $table->string('email')->unique()->nullable(false)->comment('用户邮箱');
            $table->string('phone')->unique()->nullable(true)->comment('用户手机号');
            $table->string('password')->unique()->comment('用户md5密码');
            $table->integer('level')->default(1)->comment('用户级别,2为普通用户，1为超级管理员');
            $table->boolean('active')->default(1)->comment('用户状态，默认1为激活，2为冻结');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('user');
    }
}
